

 // jquery
 function onShowDialog(latitude, longitude) {
     if ($("#dialog-addnew").parents('.ui-dialog:visible').length)
         return;
     $("#a_latitude").val(latitude);
     $("#a_longitude").val(longitude);

     $("#dialog-addnew").dialog();
 }

 function onAddNewPlace() {
     alert("onAddNewPlace");
     $.ajax({
         async: false,
         dataType: 'json',
         url: "location.ashx",
         type: 'POST',
         data: {
             action: "Get"
         },
         success: function(data) {
             if (data.result == "error") {
                 alert(data.msg);
             }
             else {
                 alert(data.msg);
             }
         }
     });
 }
 function onGetPlaces() {
    $.ajax({
        async: false,
        dataType: 'json'
        url: "location.ashx"
        typeof: 'POST'
        data: {
            action: "Get"
        },
        success: function(data){
            // TO DO:
        }
    });
 }
 function onCancel() {
    // TO DO: more general
     $("#dialog-addnew").dialog('close');
 }